package com.diver.flinkdemo.entity.xxt;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.diver.flinkdemo.enums.DataEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * <p>
 * 部门表
 * <p>
 *
 * @Author Steve
 * @Since 2019-01-22
 */
@Data
@TableName("bus_depart")
public class Depart implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(type = IdType.UUID)
    private String id;
    /**
     * 父机构ID
     */
    private String parentId;
    /**
     * 审核人id
     */
    private String approvalPerson;
    /**
     * 机构/部门名称
     */
    @Excel(name = "机构/部门名称", width = 15)
    private String departName;
    /**
     * 英文名
     */
    @Excel(name = "英文名", width = 15)
    private String departNameEn;
    /**
     * 缩写
     */
    private String departNameAbbr;
    /**
     * 排序
     */
    @Excel(name = "排序", width = 15)
    private Integer departOrder;
    /**
     * 描述
     */
    @Excel(name = "描述", width = 15)
    private String description;
    /**
     * 机构类别 1公司，2组织机构，2岗位
     */
    @Excel(name = "机构类别", width = 15, dicCode = "org_category")
    private String orgCategory;
    /**
     * 机构类型
     */
    private String orgType;
    /**
     * 机构编码
     */
    @Excel(name = "机构编码", width = 15)
    private String orgCode;
    /**
     * 上班时间
     */
    @Excel(name = "上班时间", width = 15)
    private String startWorkTime;
    /**
     * 下班时间
     */
    @Excel(name = "下班时间", width = 15)
    private String endWorkTime;
    /**
     * 手机号
     */
    @Excel(name = "手机号", width = 15)
    private String mobile;
    /**
     * 联系人
     */
    @Excel(name = "联系人", width = 15)
    private String linkman;
    /**
     * ucode
     */
    @Excel(name = "ucode", width = 15)
    private String ucode;
    /**
     * 传真
     */
    @Excel(name = "传真", width = 15)
    private String fax;
    /**
     * 地址
     */
    @Excel(name = "地址", width = 15)
    private String address;
    /**
     * 备注
     */
    @Excel(name = "备注", width = 15)
    private String memo;
    /**
     * 状态（1启用，0不启用）
     */
    @Excel(name = "状态（1启用，0不启用）", width = 15)
    private String status = DataEnum.ENABLE.getCode();
    /**
     * 删除状态（0，正常，1已删除）
     */
    @Excel(name = "删除状态（0，正常，1已删除）", width = 15)
    private String delFlag = DataEnum.NORMAL.getCode();
    /**
     * 对接企业微信的ID
     */
    private String qywxIdentifier;
    /**
     * 创建人
     */
    private String createBy;
    /**
     * 创建日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 更新人
     */
    private String updateBy;
    /**
     * 更新日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 租户ID
     */
    private Integer tenantId;
    /**
     * 层级
     */
    private Integer departLevel;
    /**
     * 上班弹性时长（单位：分）
     */
    private Integer elasticityTime;
    /**
     * 设备组id
     */
    @Excel(name = "设备组id", width = 15)
    private String groupId;

    // 机卡一致限制 0否1是
    private Integer isFitCard;

    // 离网限制 0否1是
    private Integer isOffline;

    // 门禁消息限制 0否1是
    private Integer isEntrance;

    // 离网限制时间
    private Integer isOfflineLimit;

    // 离网消息时间
    private Integer isOfflineRemind;

    /**
     * 重写equals方法
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        Depart depart = (Depart) o;
        return Objects.equals(id, depart.id) &&
                Objects.equals(parentId, depart.parentId) &&
                Objects.equals(departName, depart.departName) &&
                Objects.equals(departNameEn, depart.departNameEn) &&
                Objects.equals(departNameAbbr, depart.departNameAbbr) &&
                Objects.equals(departOrder, depart.departOrder) &&
                Objects.equals(description, depart.description) &&
                Objects.equals(orgCategory, depart.orgCategory) &&
                Objects.equals(orgType, depart.orgType) &&
                Objects.equals(orgCode, depart.orgCode) &&
                Objects.equals(startWorkTime, depart.startWorkTime) &&
                Objects.equals(endWorkTime, depart.endWorkTime) &&
                Objects.equals(mobile, depart.mobile) &&
                Objects.equals(linkman, depart.linkman) &&
                Objects.equals(fax, depart.fax) &&
                Objects.equals(address, depart.address) &&
                Objects.equals(memo, depart.memo) &&
                Objects.equals(status, depart.status) &&
                Objects.equals(delFlag, depart.delFlag) &&
                Objects.equals(createBy, depart.createBy) &&
                Objects.equals(createTime, depart.createTime) &&
                Objects.equals(updateBy, depart.updateBy) &&
                Objects.equals(updateTime, depart.updateTime) &&
                Objects.equals(groupId, depart.groupId)&&
                Objects.equals(isFitCard, depart.isFitCard) &&
                Objects.equals(isOffline, depart.isOffline) &&
                Objects.equals(isEntrance, depart.isEntrance) &&
                Objects.equals(isOfflineLimit, depart.isOfflineLimit) &&
                Objects.equals(isOfflineRemind, depart.isOfflineRemind);
    }

    /**
     * 重写hashCode方法
     */
    @Override
    public int hashCode() {

        return Objects.hash(super.hashCode(), id, parentId, departName,
                departNameEn, departNameAbbr, departOrder, description, orgCategory, startWorkTime, endWorkTime,
                orgType, orgCode, mobile, linkman, fax, address, memo, status,
                delFlag, createBy, createTime, updateBy, updateTime, groupId, isFitCard, isOffline, isEntrance,
                isOfflineLimit, isOfflineRemind);
    }
}
